#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

class Teacher(object):
    name = "xiong"

    def tclass(self):
        print("班级")


t1 = Teacher()

t1.name = "hei"
t1.age = 100
t1.sex = "male"

print(t1.__dict__)  # {'name': 'hei', 'age': 100, 'sex': 'male'}


def init(obj, x, y, z):
    obj.name = x
    obj.age = y
    obj.sex = z


t2 = Teacher()                # 生成一个类对象
t3 = Teacher()
init(t2, "bai", 100, "male")  # 初始化属性 {'name': 'bai', 'age': 100, 'sex': 'male'}
init(t3, "hong", 100, "female")  # 初始化属性 {'name': 'hong', 'age': 100, 'sex': 'female'}
print(t2.__dict__)
print(t3.__dict__)
